package org.aersoft.jokebook.database;

import org.aersoft.jokebook.dao.AppDAO;
import org.aersoft.jokebook.dao.api.IAppDAO;

/**
 * Constants to be used by database tools when the system executes the sql
 * queries on the database.
 * @see IAppDAO
 * @author Danilo de Godoy Carolino
 */
public class DatabaseQueries {

	/**
	 * SQL Query to get the table attributes by the category filter (category
	 * id). It's used by getJokeListByCategory() method on the {@link AppDAO}
	 * class.
	 * @see IAppDAO
	 */
	public static final String queryFirstMethodDAO = "SELECT category_id, content, _id, title, description, author, date FROM item WHERE category_id = ";

	/**
	 * SQL Query to get the table attributes by the category filter (item id).
	 * It's used by getJokeListByCategory() method on the {@link AppDAO} class.
	 * @see IAppDAO
	 */
	public static final String querySecondMethodDAO = "SELECT * FROM item WHERE _id = ";

	/**
	 * SQL Query to get the category name. It's used by getJokeListByCategory()
	 * method on the {@link AppDAO} class.
	 * @see IAppDAO
	 */
	public static final String queryCategoryById = "SELECT _id, name, role FROM item_category WHERE _id = ";

	/**
	 * SQL Query to get the category. It's used by getJokeAllCategories() method
	 * on the {@link AppDAO} class.
	 * @see IAppDAO
	 */
	public static final String getAllCategories = "SELECT _id, name FROM item_category";
}
